{% extends "base.html" %}

{% block title %}编辑环境信息{% endblock %}

{% block content %}
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h4 class="mb-0">编辑环境信息</h4>
                </div>
                <div class="card-body">
                    <form method="post">
                        <div class="mb-3">
                            <label for="temperature_range" class="form-label">温度范围</label>
                            <input type="text" class="form-control" id="temperature_range" 
                                   name="temperature_range" 
                                   value="{{ environment.temperature_range if environment else '' }}"
                                   placeholder="例如：-10°C ~ 40°C">
                        </div>
                        <div class="mb-3">
                            <label for="humidity_range" class="form-label">湿度范围</label>
                            <input type="text" class="form-control" id="humidity_range" 
                                   name="humidity_range"
                                   value="{{ environment.humidity_range if environment else '' }}"
                                   placeholder="例如：20% ~ 80%">
                        </div>
                        <div class="mb-3">
                            <label for="electromagnetic" class="form-label">电磁干扰情况</label>
                            <textarea class="form-control" id="electromagnetic" name="electromagnetic" 
                                    rows="3" placeholder="描述电磁干扰情况">{{ environment.electromagnetic if environment else '' }}</textarea>
                        </div>
                        <div class="mb-3">
                            <label for="layout" class="form-label">空间布局</label>
                            <textarea class="form-control" id="layout" name="layout" 
                                    rows="3" placeholder="描述空间布局情况">{{ environment.layout if environment else '' }}</textarea>
                        </div>
                        <div class="text-end">
                            <a href="{{ url_for('main.project_detail', project_id=project.id) }}" 
                               class="btn btn-secondary">取消</a>
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 